package com.doyo.controller;

import com.doyo.bean.UploadResult;
import com.doyo.service.FileuploadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author zy.du
 * @date 2020/11/16 10:51 AM
 */
public class UpLoadController {

    @Autowired
    private FileuploadService fileuploadService;
    @PostMapping("/upload")
    @ResponseBody
    public UploadResult upload(@RequestParam("file") MultipartFile multipartFile) {
        return this.fileuploadService.upload(multipartFile);
    }
}
